package club.yunqiang.club.templatedownload.controller;

import club.yunqiang.club.templatedownload.service.ITemplateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;

@Controller
@RequestMapping(value ="/template")
public class TemplateController {

    @Autowired
    private ITemplateService templateService;

    /**
     * 下载模板
     */
    @GetMapping("/download/{templateCode}")
    public void download(@PathVariable("templateCode") String templateCode, HttpServletResponse response) {
        templateService.download(templateCode, response);
    }

}
